/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.autoescola.core.entity.questionary;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author leonardo luz fernandes
 * @verion 0.1
 * @since 01/11/2010
 */

@XmlRootElement(name="Answer")
@Entity
@Table(name="answer")
public class Answer implements java.io.Serializable {

    private Long id;
    private Question question;

    private String aChoiceDescription;
    private String bChoiceDescription;
    private String cChoiceDescription;
    private String dChoiceDescription;
    private String eChoiceDescription;

    private boolean aChoiceCorrect;
    private boolean bChoiceCorrect;
    private boolean cChoiceCorrect;
    private boolean dChoiceCorrect;
    private boolean eChoiceCorrect;

    private boolean singleChoice;

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="id",nullable=false,unique=true)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name="a_choice_correct",nullable=false)
    public boolean isaChoiceCorrect() {
        return aChoiceCorrect;
    }

    public void setaChoiceCorrect(boolean aChoiceCorrect) {
        this.aChoiceCorrect = aChoiceCorrect;
    }

    @Column(name="a_choice_description",nullable=false)
    public String getaChoiceDescription() {
        return aChoiceDescription;
    }

    public void setaChoiceDescription(String aChoiceDescription) {
        this.aChoiceDescription = aChoiceDescription;
    }

    @Column(name="b_choice_correct",nullable=false)
    public boolean isbChoiceCorrect() {
        return bChoiceCorrect;
    }

    public void setbChoiceCorrect(boolean bChoiceCorrect) {
        this.bChoiceCorrect = bChoiceCorrect;
    }

    @Column(name="b_choice_description",nullable=false)
    public String getbChoiceDescription() {
        return bChoiceDescription;
    }

    public void setbChoiceDescription(String bChoiceDescription) {
        this.bChoiceDescription = bChoiceDescription;
    }

    @Column(name="c_choice_correct",nullable=false)
    public boolean iscChoiceCorrect() {
        return cChoiceCorrect;
    }

    public void setcChoiceCorrect(boolean cChoiceCorrect) {
        this.cChoiceCorrect = cChoiceCorrect;
    }

    @Column(name="c_choice_description",nullable=false)
    public String getcChoiceDescription() {
        return cChoiceDescription;
    }

    public void setcChoiceDescription(String cChoiceDescription) {
        this.cChoiceDescription = cChoiceDescription;
    }

    @Column(name="d_choice_correct",nullable=false)
    public boolean isdChoiceCorrect() {
        return dChoiceCorrect;
    }

    public void setdChoiceCorrect(boolean dChoiceCorrect) {
        this.dChoiceCorrect = dChoiceCorrect;
    }

    @Column(name="d_choice_description",nullable=false)
    public String getdChoiceDescription() {
        return dChoiceDescription;
    }

    public void setdChoiceDescription(String dChoiceDescription) {
        this.dChoiceDescription = dChoiceDescription;
    }

    @Column(name="e_choice_correct",nullable=true)
    public boolean iseChoiceCorrect() {
        return eChoiceCorrect;
    }


    public void seteChoiceCorrect(boolean eChoiceCorrect) {
        this.eChoiceCorrect = eChoiceCorrect;
    }

    @Column(name="e_choice_description",nullable=true)
    public String geteChoiceDescription() {
        return eChoiceDescription;
    }

    public void seteChoiceDescription(String eChoiceDescription) {
        this.eChoiceDescription = eChoiceDescription;
    }

    @OneToOne(targetEntity=Question.class)
    @JoinColumn(table="question",columnDefinition="question_id",referencedColumnName="id")
    public Question getQuestion() {
        return question;
    }

    public void setQuestion(Question question) {
        this.question = question;
    }

    @Column(name="single_choice",nullable=false)
    public boolean isSingleChoice() {
        return singleChoice;
    }

    public void setSingleChoice(boolean singleChoice) {
        this.singleChoice = singleChoice;
    }



}//end klazz
